package team.nmsg.ge.system.init;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class NMSWebAppConfigurer  extends WebMvcConfigurerAdapter {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
    	
    	String userDir = System.getProperty("user.dir");
    	
    	String replace = userDir.replace("\\", "/");
    	
        registry.addResourceHandler("/resources/**")
//        	.addResourceLocations("classpath:/resources/")
        	.addResourceLocations("file:"+replace+"/resources/")
        	.addResourceLocations("file:"+replace+"/files/");
        
        
        super.addResourceHandlers(registry);
        
    }

    
    public static void main(String[] args) {
		
    	String a = "E:\\D\\OrderWorkSpace\\nmsweb_root\\nmsweb_RestBootstrap";
    	
    	System.out.println(  a.replace("\\\\", "/") );
    	
	}
    
    
}